package com.itgone.config.execute;

import com.itgone.common.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class GlobalExceptionHandler {

    @ExceptionHandler(Exception.class)
    public R<String> exception(Exception e) {
        String message = e.getMessage();
        e.printStackTrace();
        return R.failed(message);
    }
}
